<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019\10\9 0009
 * Time: 14:42
 */
include 'MakeCodeClass.php';
$res=new MakeCode();
$obj='$orderShip';
// $str='harvester_receive_name,harvester_receive_mobile,harvester_receive_state,harvester_receive_city,harvester_receive_district,harvester_receive_address,report_receive_email,report_receive_name,report_receive_state,report_receive_city,report_receive_district,report_receive_address,report_receive_address,harvester_receive_email,harvester_default_report';
$obj='$order';
$str='shipping_name,shipping_code';
$obj='$input_info';
$str='id_number,ethnicity,sample_amount,client_name,disease_phase,contact_name,test_institute,contact_number,memo,contact_email,contact_address,height,weight,smoke_history,cancer_code,drug_history,disease_history,birth_date,pathological_diagnosis,diagnosis_time,tumor_location,pathology_source,inspect_reason,hemolysis,sales_name,doctor_name,rhs_info_new,create_time,contact_address_region,contact_address_detail,if_confirm,uid,client_gender';
$str='id,sample_type_code,sample_amount,sample_collect_time,test_code,pathology_source ,input_info_id ,if_confirm,barcode ,sample_code';

$notes='修改订单物流';
$route='changeWuliu';
$array=explode(',',$str);
//生成修改的对象
echo '生成编辑';
echo '<br>';
echo $res->editall($obj,  $str,   $notes,   $route);
echo '<br>';
//生成添加
echo '生成添加';
echo '<br>';
echo $res->addall($obj,  $str,   $notes,   $route);
echo '<br>';

//生成删除
echo '生成删除';
echo '<br>';
echo $res->delall($obj,  $str,   $notes,   $route);
//生成查询
echo '生成查询';
echo '<br>';
echo $res->delall($obj,  $str,   $notes,   $route);

echo '<br>';
//生成实体
//$str='harvester_receive_name,harvester_receive_mobile,harvester_receive_state,harvester_receive_city,harvester_receive_district,harvester_receive_address,report_receive_email,report_receive_name,report_receive_state,report_receive_city,report_receive_district,report_receive_address,report_receive_address,harvester_receive_email,harvester_default_report';
//$str='harvester_receive_name';

$str='id,order_num,test_code,num,title,price,total_fee,pic_path,create_time,sample_code,barcode,status,refund_fee,refund_reason,refund_time';

$str='type,item_id';
echo '生成实体';
echo '<br>';
//生成实体
echo $res->makeEntityss($str);
echo '<br>';

echo '生成attrs类型的插入的字段';
echo '<br>';
//生成实体
$str='id,id_number,ethnicity,sample_amount,client_name,disease_phase,contact_name,test_institute,contact_number,memo,contact_email,contact_address,height,weight,smoke_history,cancer_code,drug_history,disease_history,birth_date,pathological_diagnosis,diagnosis_time,tumor_location,pathology_source,inspect_reason,hemolysis,sales_name,doctor_name,rhs_info_new,create_time,contact_address_region,contact_address_detail,if_confirm,uid,client_gender';
$str='id,sample_type_code,sample_amount,sample_collect_time,test_code,pathology_source,input_info_id,if_confirm,barcode,sample_code';

$str='id,order_num,test_code,num,title,price,total_fee,pic_path,create_time,sample_code,barcode,status,refund_fee,refund_reason,refund_time';
$array=explode(',',$str);
$strnew='';
foreach($array as $key => $v){
    //生成3行
//   echo "'".$v."',";
//    if($key %3==0){
//        echo "<br>";
//    }
    //生成查询插入的一行
    echo "'oi.".$v."',";
}
echo  $strnew;
echo '<br>';


die();
$request = new HttpRequest();
var_dump($request);
die();



$request->setUrl('http://localhost:8000/sample/add');
$request->setMethod(HTTP_METH_POST);

$request->setQueryData(array(
    'province	云南' => '',
    'price_id' => '',
    'if_combo	0' => '',
    'combo_type' => '',
    'dna_assign' => '',
    'sample_type_desc' => '',
    'mailChecked	1' => '',
    'barcode	121212121' => '',
    'sample_collect_time	2019-09-23 08' => '00:00',
    'sample_receive_time	2019-10-15 10' => '26:13',
    'sample_amount	12' => '',
    'sample_status	-2' => '',
    'sample_type_code	101' => '',
    'cancer_code	0' => '',
    'disease_phase	303' => '',
    'client_name	The1' => '',
    'id_number	431121190808052331' => '',
    'client_gender	M' => '',
    'birth_date	1908-08-05' => '',
    'height' => '',
    'weight' => '',
    'smoke_history	{"smoke_freq"' => '"","smoke_years":"","passive_smoke":"","no_smoke_years":"","checked_options":[]}',
    'ethnicity	汉族' => '',
    'contact_name	121190808052336' => '',
    'contact_number	13045567890' => '',
    'contact_email	yuxing.bao@bettapharma.com' => '',
    'contact_address	北京市 北京市 东城区I' => '',
    'drug_history	{"is_target"' => '"","is_chemotherapy":"","target_end_date":"","target_treatment":"","target_begin_date":"","chemotherapy_cycle":"","chemotherapy_treatment":"","last_chemotherapy_date":"","checked_options":[]}',
    'disease_history	{"operation_history"' => '{"is_operation":"","operation_des":"","operation_date":""},"infectious_diseases":{"is_infectious":"","infectious_des":""},"family_cancer_history":{"relation":"","is_cancer":"","tumor_types":""}}',
    'test_institute' => '',
    'test_priority	301' => '',
    'test_code	1503' => '',
    'pd_l1' => '',
    'msi	0' => '',
    'project_code	10006' => '',
    'lab_code	1001' => '',
    'order_type	3' => '',
    'sample_code	' => '',
    'memo' => '',
    'pathology_source	{"checked_option"' => '"","operation":"","biopsy_method":"","biopsy_location":""}',
    'pathological_diagnosis' => '',
    'tumor_location' => '',
    'diagnosis_time' => '',
    'inspect_reason' => '',
    'he_tintedfilm' => '',
    'form_type	NGS' => '',
    'dna_priority	-1' => '',
    'rhs_info' => '',
    'rhs_info_new' => '',
    'group_meta' => '',
    'sales_name	包宇鑫' => '',
    'doctor_name' => '',
    'trait_code	100' => '',
    'cost_center	B53406' => '',
    'is_stop	-1' => '',
    'express_number' => '',
    'uid	113' => '',
    'patient_id' => '',
    'clinical_symptom' => '',
    'concise_status	0' => '',
    'is_app	1' => '',
    'is_app%091' => '',
    'concise_status%090' => '',
    'uid%09113' => '',
    'is_stop%09-1' => '',
    'cost_center%09B53406' => '',
    'trait_code%09100' => '',
    'sales_name%09%E5%8C%85%E5%AE%87%E9%91%AB' => '',
    'dna_priority%09-1' => '',
    'form_type%09NGS' => '',
    'pathology_source%09{%22checked_option%22' => '%22%22,%22operation%22:%22%22,%22biopsy_method%22:%22%22,%22biopsy_location%22:%22%22}',
    'sample_code%09' => '',
    'order_type%093' => '',
    'lab_code%091001' => '',
    'project_code%0910006' => '',
    'msi%090' => '',
    'test_code%091503' => '',
    'test_priority%09301' => '',
    'disease_history%09{%22operation_history%22' => '{%22is_operation%22:%22%22,%22operation_des%22:%22%22,%22operation_date%22:%22%22},%22infectious_diseases%22:{%22is_infectious%22:%22%22,%22infectious_des%22:%22%22},%22family_cancer_history%22:{%22relation%22:%22%22,%22is_cancer%22:%22%22,%22tumor_types%22:%22%22}}',
    'drug_history%09{%22is_target%22' => '%22%22,%22is_chemotherapy%22:%22%22,%22target_end_date%22:%22%22,%22target_treatment%22:%22%22,%22target_begin_date%22:%22%22,%22chemotherapy_cycle%22:%22%22,%22chemotherapy_treatment%22:%22%22,%22last_chemotherapy_date%22:%22%22,%22checked_options%22:[]}',
    'contact_address%09%E5%8C%97%E4%BA%AC%E5%B8%82%20%E5%8C%97%E4%BA%AC%E5%B8%82%20%E4%B8%9C%E5%9F%8E%E5%8C%BAI' => '',
    'contact_email%09yuxing.bao@bettapharma.com' => '',
    'contact_number%0913045567890' => '',
    'contact_name%09121190808052336' => '',
    'ethnicity%09%E6%B1%89%E6%97%8F' => '',
    'smoke_history%09{%22smoke_freq%22' => '%22%22,%22smoke_years%22:%22%22,%22passive_smoke%22:%22%22,%22no_smoke_years%22:%22%22,%22checked_options%22:[]}',
    'birth_date%091908-08-05' => '',
    'client_gender%09M' => '',
    'id_number%09431121190808052331' => '',
    'client_name%09The1' => '',
    'disease_phase%09303' => '',
    'cancer_code%090' => '',
    'sample_type_code%09101' => '',
    'sample_status%09-2' => '',
    'sample_amount%0912' => '',
    'sample_receive_time%092019-10-15%2010' => '26:13',
    'sample_collect_time%092019-09-23%2008' => '00:00',
    'barcode%09121212121' => '',
    'mailChecked%091' => '',
    'if_combo%090' => '',
    'province%09%E4%BA%91%E5%8D%97' => ''
));

$request->setHeaders(array(
    'cache-control' => 'no-cache',
    'Connection' => 'keep-alive',
    'Content-Length' => '7188',
    'Accept-Encoding' => 'gzip, deflate',
    'Content-Type' => 'multipart/form-data; boundary=--------------------------719107345295723418158590',
    'Host' => 'localhost:8000',
    'Postman-Token' => 'e8588e69-1e34-4ba4-8063-bd884cc58ea5,8aa96a2a-f1bb-4fc9-b0af-f85ccf9fc9fc',
    'Cache-Control' => 'no-cache',
    'Accept' => '*/*',
    'User-Agent' => 'PostmanRuntime/7.18.0',
    'Cookie' => 'PHPSESSID=nghffv6flf6pk2pk61lbe9houe; REMEMBERME=QXBwQnVuZGxlXEVudGl0eVxVc2VyczpiR2xrWlcxcGJnPT06MTU3MTcyODE2MTo2NzVmMjM2ZDZhZjAwNjBkOGY4NDRhMWEyMzk4YmU0YmU1NDEwMjVmZjI5MzE2ZDkzZjJkZjFmMTZjY2FkYTVh; sys_key=XqcZBWbL__HtXrU_zjYo7wZ4P6RtW8TQs71, PHPSESSID=nghffv6flf6pk2pk61lbe9houe; REMEMBERME=QXBwQnVuZGxlXEVudGl0eVxVc2VyczpiR2xrWlcxcGJnPT06MTU3MTcyODE2MTo2NzVmMjM2ZDZhZjAwNjBkOGY4NDRhMWEyMzk4YmU0YmU1NDEwMjVmZjI5MzE2ZDkzZjJkZjFmMTZjY2FkYTVh; sys_key=XqcZBWbL__HtXrU_zjYo7wZ4P6RtW8TQs71; PHPSESSID=m8p4n9fpnfa0pcamh0i2l93pn1',
    'content-type' => 'multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW'
));

$request->setBody('------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="province"


------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="price_id"


------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="if_combo"

0
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="combo_type"


------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="dna_assign"


------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="sample_type_desc"


------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="mailChecked"

1
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="barcode"

121212121
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="sample_amount"

12
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="sample_status"

-2
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="sample_type_code"

101
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="cancer_code"

0
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="disease_phase"

303
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="client_name"

The1
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="id_number"

431121190808052331
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="client_gender"

M
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="height"


------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="weight"


------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="smoke_history"

{"smoke_freq":"","smoke_years":"","passive_smoke":"","no_smoke_years":"","checked_options":[]}
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="ethnicity"

汉族
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="contact_name"

121190808052336
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="contact_number"

13045567890
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="contact_email"

App222@163.com
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="contact_address"

北京市北京市东城区I
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="drug_history"

{"is_target":"","is_chemotherapy":"","target_end_date":"","target_treatment":"","target_begin_date":"","chemotherapy_cycle":"","chemotherapy_treatment":"","last_chemotherapy_date":"","checked_options":[]}
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="disease_history"

{"operation_history":{"is_operation":"","operation_des":"","operation_date":""},"infectious_diseases":{"is_infectious":"","infectious_des":""},"family_cancer_history":{"relation":"","is_cancer":"","tumor_types":""}}
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="test_institute"


------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="test_priority"

301
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="test_code"

1503
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="pd_l1"


------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="msi"

0
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="project_code"

10006
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="lab_code"

1001
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="order_type"

3
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="sample_code"

P9110034
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="memo"


------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="pathology_source"

{"checked_option":"","operation":"","biopsy_method":"","biopsy_location":""}
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="pathological_diagnosis"


------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="tumor_location"


------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="diagnosis_time"


------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="inspect_reason"


------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="he_tintedfilm"


------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="form_type"

NGS
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="dna_priority"

-1
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="rhs_info"


------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="rhs_info_new"


------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="group_meta"


------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="sales_name"

234
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="doctor_name"


------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="trait_code"

100
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="cost_center"

2
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="is_stop"

-1
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="express_number"


------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="uid"

113
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="patient_id"


------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="clinical_symptom"


------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="concise_status"

0
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="is_app"

1
------WebKitFormBoundary7MA4YWxkTrZu0gW--');

try {
    $response = $request->send();

    echo $response->getBody();
} catch (HttpException $ex) {
    echo $ex;
}
